<?php
$section = 'booking';

$titre = _LB_BOOKING_MANAGEMENT;
$smarty->assign("titre", $titre);

$backlink = Session::getBackLink($section);
$id = Request::getNumber("id");
$act = Request::getIntNumber('act');

$booking = new Booking();
if($id <=0 || !$booking->get($id)){
	redirect(APPLICATION_URL."/");
}

$sql_service = "DELETE FROM BOOKING_DETAIL_SERVICE WHERE ID_BOOKING_DETAIL IN (SELECT ID FROM BOOKING_DETAIL WHERE ID_BOOKING = '{$id}')";
$sql_detail = "DELETE FROM BOOKING_DETAIL WHERE ID_BOOKING = '{$id}'";
$sql = "DELETE FROM BOOKING WHERE ID = '{$id}'";
$booking->query($sql_service);
$booking->query($sql_detail);
$booking->query($sql);
redirect($backlink);


